package cn.echo.ecc.feign;

import cn.echo.ecc.doc.CourseDoc;
import cn.echo.ecc.fallback.CourseESServiceFallbackFactory;
import cn.echo.ecc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-search",fallbackFactory = CourseESServiceFallbackFactory.class)
public interface CourseESService {

    @RequestMapping(value="/course/save",method= RequestMethod.POST)
    JSONResult saveCourse(@RequestBody CourseDoc courseDoc);

    @RequestMapping(value="/course/deleteCourse/{id}",method= RequestMethod.DELETE)
    JSONResult deleteCourse(@PathVariable("id") Long id);
}
